<{css app="ome" src="ome.css"}>
<{script src="coms/LodopFuncs.js" app="desktop"}>
    
    <{button label="打印预览" type="button" class="btn-primary" id="btn_con" onclick="javascript:doPrint(1);"}>
    <{button label="打印设置" type="button" class="btn-primary" id="btn_con" onclick="javascript:doPrint(2);"}>
    <{button label="直接打印" type="button" class="btn-primary" id="btn_con" onclick="javascript:doPrint(3);"}>
    <div id="dy" >
    <{assign var="key" value="0"}>
    <{foreach from=$res item=his}>
    <{assign var="key" value=$key+1 }>

        <div id='page<{$key}>' style="width:570pt;min-height:254.78pt;" >
            <div style="width:570pt;min-height:254.78pt;border:1px solid #b8dcff;" ><!--border:1px solid #b8dcff;-->

            <table  cellpadding="1" cellspacing="0"  style='border-color:#999999 ; width:570pt;min-height:254.78pt;border-collapse:collapse;table-layout:fixed;'>
                <tr>
                    
                    <td >
                        <div style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table  cellpadding="0" cellspacing="0" style='border-color:#999999 ;width:570pt;'>
                                <tr style='height:20pt;'>
                                    <td class="xl69" style='height:20pt;border-right:none;border-bottom:none;text-align: center;' >&nbsp;</td>
                                </tr>
                            </table></div>
                        <div style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table cellpadding="0" cellspacing="0" style='border-color:#999999 ; width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr  style='height:25.00pt;'>
                                    <td class="xl69" style='width:470pt;border-right:none;border-bottom:none;text-align: center;'></td>
                                    <td class="xl69" style='border-right:none;border-bottom:none;text-align: left;'><{$his.deliverynote_bn}></td>
                                </tr>
                            </table></div>
                        <div  style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table cellpadding="0" cellspacing="0" style='border-color:#999999 ; width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr  class="xl65" style='height:25.0pt;mso-height-source:userset;mso-height-alt:510;'>
                                    <td class="xl70" style='width:39.00pt;' x:str></td>
                                    <td class="xl70" style='width:68.00pt;' x:str><{$his.AXCustomer}></td>
                                    <td class="xl70" style='width:34.00pt;' x:str></td>
                                    <td class="xl70" style='width:39.00pt;' x:str><{$his.operator}></td>
                                    <td class="xl70" style='width:51.00pt;' x:str></td>
                                    <td class="xl70" style='width:69.00pt;' x:str><{$his.axorderno}></td>
                                    <td class="xl70" style='' x:str><{$his.deliverytype}></td>
                                    <td class="xl70" style='' x:str><{$his.create_time}></td>
                                </tr>
                            </table>
                        </div>
                        <div  style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table  cellpadding="0" cellspacing="0" style='border-color:#999999 ;width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr  class="xl65" style='height:25.0pt;'>
                                    <td class="xl70" style='width:39.00pt;' x:str></td>
                                    <td class="xl70" style='width:256.00pt;' x:str><{$his.customername}></td>
                                    <td class="xl70" style='width:64.00pt;' x:str></td>
                                    <td class="xl70" style='' x:str><{$his.soprojecter}></td>
                                </tr>
                            </table>
                        </div>
                        <div  style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table cellpadding="0" cellspacing="0" style='border-color:#999999 ;width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr  class="xl65" style='height:25.00pt;'>
                                    <td class="xl70" style='width:39pt;' x:str></td>
                                    <td class="xl70" style='width:380pt;' x:str><{$his.shipaddress}></td>
                                    <td class="xl70" style='width:39pt;' x:str></td>
                                    <td class="xl70"  x:str><{$his.carno}></td>
                                </tr>
                            </table>
                        </div>
                        <div  style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table cellpadding="0" cellspacing="0" style='border-color:#999999 ;width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr  class="xl65" style='height:22.00pt;'>
                                    <td class="xl70" style='width:65pt;' x:str></td>
                                    <td class="xl70" style='width:94pt;padding-bottom: 7px' x:str><{$his.axorderno}></td>
                                    <td class="xl70" style='width:48pt;' x:str></td>
                                    <td class="xl70" style='width:88pt;' x:str><{$his.accountmethod}></td>
                                    <td class="xl70" style='width:37pt;' x:str></td>
                                    <td class="xl70" style='width:104pt;' x:str><{$his.contact}></td>
                                    <td class="xl70" style='width:29pt;' x:str></td>
                                    <td class="xl70" style='width:100pt;text-align: left;' x:str><{$his.contacttel}></td>
                                    <td class="xl70" style='' x:str></td>
                                </tr>
                            </table>
                        </div>
                        <div style='overflow:hidden;white-space:nowrap;text-overflow:ellipsis;'>
                            <table cellpadding="1" cellspacing="0" style='border-color:#999999 ;width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr style='height:25pt;'>
                                    <td class="xl69" colspan="6" style='border-right:none;border-bottom:none;text-align: center;' >&nbsp;</td>
                                </tr>
                            </table></div>
                        <div style="width:570pt;min-height:140pt;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">
                            <table cellpadding="0" cellspacing="0" style='border-color:#999999 ; width:570pt;border-collapse:collapse;table-layout:fixed;word-break:break-all; word-wrap:break-word;'>
                            <{assign var="totol_num" value=0 }>
                            <{foreach from=$his.compline_data item=line}>

                                <tr style='height:23pt;'>
                                <td class="xl70" style='width:8pt;visibility: hidden;' x:str><{$totol_num=$totol_num+$line.number }></td>
                                <td class="xl70" style='width:70pt;text-align: left;' x:str><{$line.material_bn}></td>
                                <td class="xl70" style='width:2pt;' x:str></td>
                                <td class="xl70" style='width:68pt;text-align: left;' x:str>
                                <{$line.code}></td>
                                <td class="xl70" style='width:20pt;' x:str></td>
                                <td class="xl70" style='width:156pt;text-align: left;word-break:break-all; word-wrap:break-word;' x:str><{$line.material_name}></td>
                                <td class="xl70" style='width:10pt;' x:str></td>
                                <td class="xl70" style='width:65pt;' x:str><{$line.specifications}></td>
                                <td class="xl70" style='width:50pt;' x:str><{$line.unit}></td>
                                <td class="xl70" style='width:48pt;text-align: left;' x:str><{$line.number}></td>
                                <td class="xl70" style='' x:str></td>
                              </tr>
                            <{/foreach}>
                            </table>
                        </div>
                        <div >
                            <table cellpadding="0" cellspacing="0" style='border-color:#999999 ;width:570pt;border-collapse:collapse;table-layout:fixed;'>
                                <tr  class="xl65" style='height:25.00pt;'>
                                    <td class="xl69" style='width:30pt;' >&nbsp;</td>
                                    <td class="xl70" style='width:70pt;padding-bottom: 11px' x:str>电商仓</td>
                                    <td class="xl70" style='width:272pt;' x:str></td>
                                    <td class="xl70" style='width:70pt;padding-bottom: 11px' x:str><{$totol_num}></td>
                                    <td class="xl70" style='' x:str></td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        </div>
    <{/foreach}>
    </div>
 <OBJECT  ID="jatoolsPrinter" CLASSID="CLSID:B43D3361-D075-4BE2-87FE-057188254255"
                  codebase="jatoolsPrinter.cab#version=8,6,0,0"></OBJECT>
<script>
    function doPrint(how) {
            var myDoc = {
                // settings:{
                //     paperWidth : 3000, 
                //     paperHeight : 2000, 
                //     topMargin:0,
                //     leftMargin:0,
                //     bottomMargin:0,
                //     rightMargin:0,
                //     printer:'FMPrinter',
                //     orientation:1
                // },   // 选择横向打印,1为纵向，2为横向
                //settingsID:"mysettings1",
                documents: document,
                copyrights: '杰创软件拥有版权  www.jatools.com'
            }; 
        var jatoolsPrinter = document.getElementById("jatoolsPrinter");
        if (how == '1')
            jatoolsPrinter.printPreview(myDoc); // 打印预览
        else if (how == '2')
            jatoolsPrinter.print(myDoc, true); // 打印前弹出打印设置对话框
        else
            jatoolsPrinter.print(myDoc, false); // 不弹出对话框打印

    }
</script>
       